<!DOCTYPE html>
<%@page import="java.util.Collection"%>
<html lang="en">
<%@page import="karaokestrong.modelo.Sala"%>
<%@page import="java.util.ArrayList"%>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
	
	<title>Karaoke Strong</title>

	<script src="js/jquery-1.10.2.js"></script>
	<script src="js/jquery-ui-1.10.3.js"></script>
  <script src="js/bootstrap.js"></script>
		
    <!-- Le styles -->
   <link href="css/bootstrap.css" rel="stylesheet">    
   <link href="css/bootstrap-responsive.css" rel="stylesheet">
	 <link href="css/bootswatch.css" rel="stylesheet">
   <link href="css/jquery-ui-1.10.3.css" rel="stylesheet">
	
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    
  </head>
 <body class="preview">
	
    <div class="navbar navbar-inverse navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container">
          <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </a>
          <a class="brand" href="index.jsp">Sistema Karaoke Strong</a>
          <div class="nav-collapse collapse">
            <ul class="nav">
              <li class="active"><a href="#">Bienvenidos</a></li>
              <li><a href="#about">Acerca</a></li>
              <li><a href="#contact">Contactanos</a></li>
              <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
                 <ul class="dropdown-menu">
                  <li><a href="formlocal.jsp">Mantenimiento Local</a></li>
                  <li><a href="formSalaInsertar.jsp">Mantenimiento Salas</a></li>
                  <li><a href="formProductoInsertar.jsp">Mantenimiento Productos</a></li>
                  <li class="divider"></li>
                  <li class="nav-header">Nav header</li>
                  <li><a href="#">Separated link</a></li>
                  <li><a href="#">One more separated link</a></li>
                </ul>
              </li>
            </ul>
            <form class="navbar-form pull-right">
              <input class="span2" type="text" placeholder="Email">
              <input class="span2" type="password" placeholder="Password">
              <button type="submit" class="btn">Sign in</button>
            </form>
          </div><!--/.nav-collapse -->
        </div>
      </div>
    </div>

    <div class="container">

      <!-- Main hero unit for a primary marketing message or call to action -->
      <div class="hero-unit">
        <h1>Administrar Sala</h1>
        
         <form id="formListar" name="sala" action="ServletSalaListar" method="post" class="form-horizontal well">
        
        <fieldset>
         <legend>Listado De Salas </legend>
          <div class="form-actions">
               <ul class="nav nav-tabs">
               	 <li><a href="formSalaListar.jsp">Listar</a></li>
 			     <li><a href="formSalaMostrar.jsp">Buscar</a></li>
  			     <li><a href="formSalaActualizar.jsp">Actualizar</a></li>
  			     <li><a href="formSalaEliminar.jsp">Eliminar</a></li>
		       </ul>  
		       </div>
		<div class="span12">
			
		<input type="submit" value="Listar"/>
		<br/> <br/>
		<!-- scroll  -->
		<!-- <div style="float:left; width:30%;overflow :scroll; height:100px"> -->
		<!--<div style="overflow :scroll;">-->
		    <div style="float:center; width:75%;overflow :scroll; height:100px"> 
		    
    		<table class="table table-striped table-bordered">	
    		
    		<tr>
    	 		<th>Nombre</th>
    			<th>Capacidad</th>
    			<th>Descripcion</th>
    			<th>Estado</th>
    			<th>Local</th>
		
			</tr>

		  <%
	
				ArrayList<Sala> salas = (ArrayList<Sala>) request.getAttribute("Salas_Registradas_Listar");
				
				if (salas != null) {
					
					out.println("<tr>");
					
					for (Sala x : salas) {
						out.println("<th>" + x.getNombre() + "</th>");
						out.println("<th>"  + x.getCapacidad() + "</th>");
						out.println("<th>"  + x.getDescripcion()+ "</th>");
												
						if (x.isElog())
							out.println("<th>"  + "Eliminado" + "</th>");
						  else 
							out.println("<th>"  + "Activo" + "</th>");
						
						out.println("<th>" + x.getLocal().getNombre() +" "+ "\n" +"</th>");
						out.println("</tr>"); 
						
					}
					
					out.println("</tr>");
					} 	
		
		%>
   
        </table>
        <!-- scroll  -->
        </div> 
        </div>
        </fieldset>
        
        </form>
        </div>

      <footer>
        <p>&copy; Desarrollo Web 2013</p>
      </footer>

    </div> <!-- /container -->

  </body>
</html>